Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.1K
Visualizações
How to prevent parent div to flex in vertical direction while one of the child item flexes?[ReactJS]

So far I implemented this as below.

This is a div inside a ReactJs component:

                <div className='ChatAreaClass' as={InputMessage} style={{
                    display: "flex",
                    flexDirection: "row",
                    borderTop: "1px dashed #d1dbe4",
                    alignItems: 'end',
                    marginBottom: "5px"
                }}>
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${stickersIcon})`}}
                    />
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${gifIcon})`}}
                    />
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${emojiIcon})`}}
                    />

                    <textarea onChange={e => setTextAreaAutosize(e)}
                        className='form-control text-area' 
                        value={chatMessage} placeholder='write here ...'>
                    </textarea>

                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${arrowIcon})`}}
                    />
                </div>

css:

.ChatAreaClass {
    text-align: left;
    border-top: unset !important;
    margin-top: 0px;
}

.text-area {
    margin-left: 5px;
    margin-right: 6px;
    margin-bottom: 4px;
    border-radius: 10px;
    overflow: clip;
    margin-top: 5px;
    resize: none;
    border-color: #2200ff;
    max-height:200px;
    scrollbar-width: none;
}

Output:

enter image description here

Now, facing problem for the chat input text-area.

For a large input text messages, It hides the incoming messages. enter image description here

Expected Output is:

enter image description here

How can I achieve this? should I make 3 different div or, it is possible in some other way?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda